﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="VioletDevelopmentLaboratory.Net.Data" %>
<%@ Import Namespace="VioletDevelopmentLaboratory.Net.Web" %>
<%@ Import Namespace="VioletDevelopmentLaboratory.Net.Web.Component" %>
<%@ Import Namespace="VioletDevelopmentLaboratory.Net.Web.Configuration" %>
<%@ Import Namespace="VioletDevelopmentLaboratory.Net.Web.WebControls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			RoleGridView_Bind();
		}
	}
	
	protected void RoleGridView_Bind()
	{
		if (Roles.Enabled)
		{
			RolePanel.Visible = true;
			RoleDisablePanel.Visible = false;
			RoleGridView.DataSource = Roles.GetAllRoles();
			RoleGridView.DataBind();
		}
		else
		{
			RolePanel.Visible = false;
			RoleDisablePanel.Visible = true;
		}
	}

	protected void CreateFileFolder()
	{
		DirectoryInfo dir = null;

		dir = new DirectoryInfo(Path.Combine(VUtility.WebApplicationPhysicalPath, @"App_Data\vboard\file\board"));

		if (!dir.Exists)
		{
			try
			{
				dir.Create();

				BoardFolderLabel.Text = "O";
				BoardFolderLabel.ForeColor = Color.Green;
			}
			catch
			{
				BoardFolderLabel.Text = "X";
				BoardFolderLabel.ForeColor = Color.Red;
			}
		}
		else
		{
			BoardFolderLabel.Text = "O";
			BoardFolderLabel.ForeColor = Color.Green;
		}

		dir = new DirectoryInfo(Path.Combine(VUtility.WebApplicationPhysicalPath, @"App_Data\vboard\file\forum"));

		if (!dir.Exists)
		{
			try
			{
				dir.Create();

				ForumFolderLabel.Text = "O";
				ForumFolderLabel.ForeColor = Color.Green;
			}
			catch
			{
				ForumFolderLabel.Text = "X";
				ForumFolderLabel.ForeColor = Color.Red;
			}
		}
		else
		{
			ForumFolderLabel.Text = "O";
			ForumFolderLabel.ForeColor = Color.Green;
		}

		dir = new DirectoryInfo(Path.Combine(VUtility.WebApplicationPhysicalPath, @"App_Data\vboard\member"));

		if (!dir.Exists)
		{
			try
			{
				dir.Create();

				MemberFolderLabel.Text = "O";
				MemberFolderLabel.ForeColor = Color.Green;
			}
			catch
			{
				MemberFolderLabel.Text = "X";
				MemberFolderLabel.ForeColor = Color.Red;
			}
		}
		else
		{
			MemberFolderLabel.Text = "O";
			MemberFolderLabel.ForeColor = Color.Green;
		}

		dir = new DirectoryInfo(Path.Combine(VUtility.WebApplicationPhysicalPath, @"App_Data\vboard\log"));

		if (!dir.Exists)
		{
			try
			{
				dir.Create();

				LogFolderLabel.Text = "O";
				LogFolderLabel.ForeColor = Color.Green;
			}
			catch
			{
				LogFolderLabel.Text = "X";
				LogFolderLabel.ForeColor = Color.Red;
			}
		}
		else
		{
			LogFolderLabel.Text = "O";
			LogFolderLabel.ForeColor = Color.Green;
		}
	}
	protected void FolderCheckButton_Click(object sender, EventArgs e)
	{
		CreateFileFolder();
	}

	protected void CreateRoleButton_Click(object sender, EventArgs e)
	{
		if (Roles.Enabled && !String.IsNullOrEmpty(NewRoleNameTextBox.Text))
		{
			Roles.CreateRole(NewRoleNameTextBox.Text);

			RoleGridView_Bind();
		}
	}

	protected void WizardStep2_Active(object sender, EventArgs e)
	{
		CreateFileFolder();
	}

	protected void WizardStep5_Active(object sender, EventArgs e)
	{
		ConnectionStringNameDropDownList.DataBind();
		
		ApplicationNameTextBox.Text = VWebConfigurationReader.ApplicationName;

		String connectionStringName = VWebConfigurationReader.ConnectionStringName;

		foreach (ListItem item in ConnectionStringNameDropDownList.Items)
		{
			if (item.Value == connectionStringName)
				item.Selected = true;
			else
				item.Selected = false;
		}
	}

	protected void WizardStep6_Active(object sender, EventArgs e)
	{
		if (Roles.Enabled)
		{
			RoleDropDownList.DataSource = Roles.GetAllRoles();
			RoleDropDownList.DataBind();

			RoleDropDownList.Items.Insert(0, new ListItem("-Select-", ""));
			RoleDropDownList.Items.Insert(1, new ListItem("-none-", ""));
		}

		AdministratorRoleNameTextBox.Text = VWebConfigurationReader.Administrator.Role;
		AdministratorNamesTextBox.Text = VWebConfigurationReader.Administrator.Names;
		AdministratorEmailTextBox.Text = VWebConfigurationReader.Administrator.Email;
		PublicationReportCheckBox.Checked = VWebConfigurationReader.Administrator.PublicationReport;
	}
	protected void RoleDropDownList_SelectedIndexChanged(object sender, EventArgs e)
	{
		AdministratorRoleNameTextBox.Text = RoleDropDownList.SelectedValue;
	}

	protected void VWebBasicButton_Click(object sender, EventArgs e)
	{
		VWebConfigurationManager vwebManager = new VWebConfigurationManager();
		vwebManager.Section.ApplicationName = ApplicationNameTextBox.Text;
		vwebManager.Section.ConnectionStringName = ConnectionStringNameDropDownList.SelectedValue;
		vwebManager.Save();

		VUtility.ShowAlert(Page, "저장했습니다.");
	}

	protected void VWebAdminButton_Click(object sender, EventArgs e)
	{
		VWebConfigurationManager manager = new VWebConfigurationManager();
		manager.Section.Administrator.Email = AdministratorEmailTextBox.Text;
		manager.Section.Administrator.Names = AdministratorNamesTextBox.Text.Trim();
		manager.Section.Administrator.Role = AdministratorRoleNameTextBox.Text.Trim();
		manager.Section.Administrator.PublicationReport = PublicationReportCheckBox.Checked;
		manager.Save();

		Configuration webConfig = WebConfigurationManager.OpenWebConfiguration("~/vboard/manager");

		AuthorizationSection authorization = (AuthorizationSection)webConfig.GetSection("system.web/authorization");

		authorization.Rules.Clear();

		AuthorizationRule allowRule = new AuthorizationRule(AuthorizationRuleAction.Allow);
		allowRule.Users.AddRange(AdministratorNamesTextBox.Text.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
		allowRule.Roles.Add(AdministratorRoleNameTextBox.Text);
		authorization.Rules.Add(allowRule);

		AuthorizationRule dennyRule = new AuthorizationRule(AuthorizationRuleAction.Deny);
		dennyRule.Users.Add("*");
		authorization.Rules.Add(dennyRule);

		webConfig.Save();

		VUtility.ShowAlert(Page, "저장했습니다.");
	}

	protected void WebConfigButton_Click(object sender, EventArgs e)
	{
		Boolean exists = false;

		try
		{
			GlobalizationSectionManager globalManager = new GlobalizationSectionManager();
			globalManager.GetGlobalization().RequestEncoding = Encoding.UTF8;
			globalManager.GetGlobalization().ResponseEncoding = Encoding.UTF8;
			globalManager.GetGlobalization().ResponseHeaderEncoding = Encoding.UTF8;
			globalManager.GetGlobalization().FileEncoding = Encoding.UTF8;

			globalManager.Save();

			WebConfig_EncodingLabel.Text = "O";
			WebConfig_EncodingLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_EncodingLabel.Text = "X";
			WebConfig_EncodingLabel.ForeColor = Color.Red;
		}
		
		try
		{
			AppSettingsSectionManager appSettingsManager = new AppSettingsSectionManager();
			if (appSettingsManager.GetKeyValueConfigurationElement("VBoardVersionCheckService.VBoardVersionCheck") == null)
				appSettingsManager.Add("VBoardVersionCheckService.VBoardVersionCheck", "http://www.vdlab.net/vboardservices/VBoardVersionCheck.asmx");
			
			WebConfig_WebServiceLabel.Text = "O";
			WebConfig_WebServiceLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_WebServiceLabel.Text = "O";
			WebConfig_WebServiceLabel.ForeColor = Color.Red;
		}

		//트랙백 핸들러 추가
		try
		{
			HttpHandlersSectionManager handlerManager = new HttpHandlersSectionManager();
			exists = false;
			foreach (HttpHandlerAction handler in handlerManager.GetHandlers())
			{
				if (handler.Path == "VWebTrackback.ashx")
					exists = true;
			}
			if (!exists)
				handlerManager.AddHandler("VWebTrackback.ashx", "VioletDevelopmentLaboratory.Net.Web.Component.TrackbackHandler", "GET,POST", true);

			WebConfig_HandlerLabel.Text = "O";
			WebConfig_HandlerLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_HandlerLabel.Text = "X";
			WebConfig_HandlerLabel.ForeColor = Color.Red;
		}

		PagesSectionManager pagesManager = new PagesSectionManager();
		
		//네임스페이스 추가
		try
		{
			pagesManager.GetPages().ValidateRequest = false;
			pagesManager.Save();

			String[] namespaces = { "VioletDevelopmentLaboratory.Net.Data", "VioletDevelopmentLaboratory.Net.Web", "VioletDevelopmentLaboratory.Net.Web.Component", "VioletDevelopmentLaboratory.Net.Web.Configuration", "VioletDevelopmentLaboratory.Net.Web.WebControls" };
			foreach (String namespaceName in namespaces)
			{
				exists = false;
				foreach (NamespaceInfo namespaceInfo in pagesManager.GetNamespaces())
				{
					if (namespaceInfo.Namespace == namespaceName)
						exists = true;
				}
				if (!exists)
					pagesManager.AddNamespace(namespaceName);
			}

			WebConfig_NamespaceLabel.Text = "O";
			WebConfig_NamespaceLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_NamespaceLabel.Text = "X";
			WebConfig_NamespaceLabel.ForeColor = Color.Red;
		}

		//컨트롤 추가
		try
		{
			exists = false;
			foreach (TagPrefixInfo control in pagesManager.GetControls())
			{
				if (control.TagPrefix == "VWeb" && control.Namespace == "VioletDevelopmentLaboratory.Net.Web.WebControls")
					exists = true;
			}
			if (!exists)
				pagesManager.AddControl("VWeb", "VioletDevelopmentLaboratory.Net.Web.WebControls", "VioletDevelopmentLaboratory.Net", "", "");

			exists = false;
			foreach (TagPrefixInfo control in pagesManager.GetControls())
			{
				if (control.TagPrefix == "VWeb" && control.TagName == "Board")
					exists = true;
			}
			if (!exists)
				pagesManager.AddControl("VWeb", "", "", "Board", "~/vboard/component/board/board.ascx");

			exists = false;
			foreach (TagPrefixInfo control in pagesManager.GetControls())
			{
				if (control.TagPrefix == "VWeb" && control.TagName == "BoardSearch")
					exists = true;
			}
			if (!exists)
				pagesManager.AddControl("VWeb", "", "", "BoardSearch", "~/vboard/component/board/boardsearch.ascx");

			exists = false;
			foreach (TagPrefixInfo control in pagesManager.GetControls())
			{
				if (control.TagPrefix == "ajaxToolkit" && control.Namespace == "AjaxControlToolkit")
					exists = true;
			}
			if (!exists)
				pagesManager.AddControl("ajaxToolkit", "AjaxControlToolkit", "AjaxControlToolkit", "", "");
			
			WebConfig_ControlLabel.Text = "O";
			WebConfig_ControlLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_ControlLabel.Text = "X";
			WebConfig_ControlLabel.ForeColor = Color.Red;
		}

		//코드서브디렉터리 추가
		try
		{
			CompilationSectionManager compilationManager = new CompilationSectionManager();
			exists = false;
			foreach (CodeSubDirectory codeSubDir in compilationManager.GetCodeSubDirectories())
			{
				if (codeSubDir.DirectoryName == "vboard")
					exists = true;
			}
			if (!exists)
				compilationManager.AddCodeSubDirectory("vboard");

			WebConfig_CodeSubDirLabel.Text = "O";
			WebConfig_CodeSubDirLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_CodeSubDirLabel.Text = "X";
			WebConfig_CodeSubDirLabel.ForeColor = Color.Red;
		}

		try
		{
			HttpRuntimeSectionManager httpRuntimeManager = new HttpRuntimeSectionManager();
			httpRuntimeManager.GetHttpRuntime().ExecutionTimeout = new TimeSpan(0, 0, Int32.Parse(WebConfig_ExecutionTimeoutTextBox.Text));
			httpRuntimeManager.GetHttpRuntime().MaxRequestLength = Int32.Parse(WebConfig_MaxRequestLengthTextBox.Text);
			httpRuntimeManager.Save();

			WebConfig_HttpRuntimeLabel.Text = "O";
			WebConfig_HttpRuntimeLabel.ForeColor = Color.Green;
		}
		catch
		{
			WebConfig_HttpRuntimeLabel.Text = "X";
			WebConfig_HttpRuntimeLabel.ForeColor = Color.Red;
		}

		VUtility.ShowAlert(Page, "저장했습니다.");
	}

	protected void WebConfigWizardStep_Active(object sender, EventArgs e)
	{
		HttpRuntimeSectionManager httpRuntimeManager = new HttpRuntimeSectionManager();
		WebConfig_ExecutionTimeoutTextBox.Text = httpRuntimeManager.GetHttpRuntime().ExecutionTimeout.TotalSeconds.ToString();
		WebConfig_MaxRequestLengthTextBox.Text = httpRuntimeManager.GetHttpRuntime().MaxRequestLength.ToString();
	}

	protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
	{
		if (e.CommandName == "ConnectTest")
		{
			SqlConnection con = new SqlConnection(e.CommandArgument.ToString());

			try
			{
				con.Open();

				VUtility.ShowAlert(Page, "DB 연결 테스트 성공.");
			}
			catch
			{
				VUtility.ShowAlert(Page, "DB 연결 테스트 실패.");
			}
			finally
			{
				con.Close();
			}
		}
	}

	protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
	{
		if (e.Row.RowType == DataControlRowType.DataRow)
		{
			((Button)e.Row.FindControl("ConnectTestButton")).CommandArgument = ((ConnectionStringSettings)e.Row.DataItem).ConnectionString;
		}
	}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
	<style type="text/css">
		body, input { font-family : '맑은 고딕', '돋움', Arial, Helvetica, sans-serif; font-size : small; }
		.SideBar { width : 165px; background-color : #CC99FF; vertical-align : top; padding : 10px; }
		.Step { padding : 10px; }
	</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
		<h1>VBoard Setup</h1>
		<asp:ObjectDataSource runat="server" DeleteMethod="Remove" 
			InsertMethod="Add" SelectMethod="GetSettingsCollection" 
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.ConnectionStringsSectionManager" 
			UpdateMethod="Modify" ID="DBConnectionObjectDataSource">
		<DeleteParameters>
			<asp:Parameter Name="name" Type="String"></asp:Parameter>
		</DeleteParameters>
		<InsertParameters>
			<asp:Parameter Name="name" Type="String"></asp:Parameter>
			<asp:Parameter Name="connectionString" Type="String"></asp:Parameter>
			<asp:Parameter Name="providerName" Type="String"></asp:Parameter>
		</InsertParameters>
		<UpdateParameters>
			<asp:Parameter Name="name" Type="String"></asp:Parameter>
			<asp:Parameter Name="connectionString" Type="String"></asp:Parameter>
			<asp:Parameter Name="providerName" Type="String"></asp:Parameter>
		</UpdateParameters>
		</asp:ObjectDataSource>
    	<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Width="100%">
			<NavigationStyle BackColor="#CC99FF" />
			<WizardSteps>
				<asp:WizardStep runat="server" Title="0. 준비">
					<div>
						VBoard Setup에 앞서 다음 사항을 확인하시기 바랍니다.
						<ul>
							<li>Ajax Extention이 설치되었는지 확인합니다.</li>
							<li>Ajax ControlToolKit이 설치되었는지 확인합니다.</li>
							<li>VBoard 설정을 시작하기 전에 VBoard와 VBoard에 필요한 파일이 모두 복사되었는지 확인합니다.</li>
							<li>web.config에<br /><span style="color: #0000FF">&lt;</span><span style="color: #990033">configSections</span><span 
									style="color: #0000FF">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF">&lt;</span><span 
									style="color: #990033">section</span> <span style="color: #FF0000">name</span><span 
									style="color: #0000FF">=&quot;VWeb&quot; 
								type=&quot;VioletDevelopmentLaboratory.Net.Web.Configuration.VWebSection&quot;</span><br />
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000">allowDefinition</span><span 
									style="color: #0000FF">=&quot;MachineToApplication&quot;</span>
								<span style="color: #FF0000">allowLocation</span><span style="color: #0000FF">=&quot;false&quot; 
								/&gt;</span><br /><span style="color: #0000FF">&lt;/</span><span 
									style="color: #990033">configSections</span><span style="color: #FF0000">&gt;</span> 
								색션을 추가합니다.</li>
							<li>회원인증시스템(<span style="color: #0000FF">&lt;</span><span style="color: #990033">authentication</span> 
								<span style="color: #FF0000">mode</span><span 
									style="color: #0000FF">=&quot;Forms&quot;&gt;&lt;</span><span style="color: #990033">forms</span><span 
									style="color: #0000FF">&gt;&lt;/</span><span style="color: #990033">forms</span><span 
									style="color: #0000FF">&gt;&lt;/</span><span style="color: #990033">authentication</span><span 
									style="color: #0000FF">&gt;</span>색션)은 미리 설정합니다.</li>
							<li>SqlMembershipProvider(자격증명), SqlRoleProvider(역할), SqlProfileProvider(프로필)를 사용할 경우 미리 설정합니다.</li>
						</ul>
						위에 사항이 모두 준비가 됐으면, 1단계부터 설명에 따라 VBoard Setup을 시작합니다.
					</div>
				</asp:WizardStep>
				<asp:WizardStep runat="server" title="1. 데이터베이스 연결">
					<div>DB연결문자열을 준비합니다. 이미 VBoard에 사용할 DB연결문자열이 존재한다면 다음 단계로 진행합니다.</div>
					<div>&nbsp;</div>
					<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
						DataSourceID="DBConnectionObjectDataSource" DefaultMode="Insert">
						<Fields>
							<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
							<asp:BoundField DataField="ConnectionString" HeaderText="ConnectionString" 
								SortExpression="ConnectionString" />
							<asp:BoundField DataField="ProviderName" HeaderText="ProviderName" 
								SortExpression="ProviderName" />
							<asp:CommandField ButtonType="Button" ShowCancelButton="False" 
								ShowInsertButton="True" />
						</Fields>
					</asp:DetailsView>
					<div>&nbsp;</div>
					<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
						DataKeyNames="Name" DataSourceID="DBConnectionObjectDataSource" 
						OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound">
						<Columns>
							<asp:TemplateField InsertVisible="False" ShowHeader="False">
								<ItemTemplate>
									<asp:Button ID="ConnectTestButton" runat="server" CausesValidation="false" 
										CommandName="ConnectTest" Text="연결확인" />
								</ItemTemplate>
							</asp:TemplateField>
							<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
							<asp:BoundField DataField="ConnectionString" HeaderText="ConnectionString" 
								SortExpression="ConnectionString" />
							<asp:BoundField DataField="ProviderName" HeaderText="ProviderName" 
								SortExpression="ProviderName" />
							<asp:CommandField ButtonType="Button" ShowDeleteButton="True" />
						</Columns>
					</asp:GridView>
				</asp:WizardStep>
				<asp:WizardStep runat="server" title="2. 파일 폴더 만들기" OnActivate="WizardStep2_Active">
					<div>VBoard의 파일 업로드 폴더를 확인합니다. 모든 폴더가 만들어졌다면 다음 단계로 진행합니다.</div>
					<div>&nbsp;</div>
					<div>
						<asp:Button ID="FolderCheckButton" runat="server" Text="다시확인" 
							OnClick="FolderCheckButton_Click" />
					</div>
					<div>&nbsp;</div>
					<table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;" cellpadding="3">
						<tr>
							<td style="font-weight: bold; text-align: center">폴더</td>
							<td style="font-weight: bold; text-align: center">존재</td>
						</tr>
						<tr>
							<td>App_Data\vboard\file\board</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="BoardFolderLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>App_Data\vboard\file\forum</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="ForumFolderLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>App_Data\vboard\memer</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="MemberFolderLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>App_Data\vboard\log</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="LogFolderLabel" runat="server" /></td>
						</tr>
					</table>
				</asp:WizardStep><asp:WizardStep runat="server" Title="3. 관리자 계정 만들기">
					<div>관리자 계정을 만듭니다. 여기서는 MembershipProvider를 사용해서 계정을 만듭니다. 만약 MembershipProvider가 아닌 
						다른 회원인증시스템을 사용중이라면 해당 회원인증시스템을 사용해 계정을 만들고 현재의 단계는 건너뛰어 진행합니다. 이미 관리자 계정이 존재한다면 
						현재의 단계는 건너뛰어 진행합니다.</div>
					<div>&nbsp;</div>
					<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
						LoginCreatedUser="False">
						<WizardSteps>
						<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
						</asp:CreateUserWizardStep>
						<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
							<ContentTemplate>
								<table border="0">
									<tr>
										<td align="center" colspan="2">
											완료</td>
									</tr>
									<tr>
										<td>
											계정을 만들었습니다.</td>
									</tr>
									<tr>
										<td align="right" colspan="2">
											&nbsp;</td>
									</tr>
								</table>
							</ContentTemplate>
						</asp:CompleteWizardStep>
						</WizardSteps>
					</asp:CreateUserWizard>
				</asp:WizardStep>
				<asp:WizardStep runat="server" Title="4. 관리자 역할 만들기">
					<div>관리자 역할을 만듭니다. 이미 관리자 역할이 존재한다면 다음 단계로 진행합니다. RoleProvider를 사용하지 않는다면 현재의 단계는 건너뛰어 진행합니다. 관리자를 역할로 설정하지 않을 거라면 현재의 단계는 건너뛰어 진행합니다.</div>
					<div>&nbsp;</div>
					<asp:Panel ID="RolePanel" runat="server">
						<div><asp:TextBox ID="NewRoleNameTextBox" runat="server" />
							<asp:Button ID="CreateRoleButton" runat="server" Text="역할생성" 
								OnClick="CreateRoleButton_Click" /></div>
						<div>&nbsp;</div>
						<asp:GridView ID="RoleGridView" runat="server" ShowHeader="False" />
					</asp:Panel>
					<asp:Panel ID="RoleDisablePanel" runat="server"><asp:Label ID="RoleDisableLabel" runat="server" ForeColor="Red" Font-Bold="true" Text="RoleProvider가 사용가능하도록 설정되어 있지 않습니다." /></asp:Panel>
				</asp:WizardStep>
				<asp:WizardStep runat="server" Title="5. web.config 설정" OnActivate="WebConfigWizardStep_Active">
					<div>web.config에 필요한 구성설정을 추가합니다. 저장에 성공하면 다음 단계로 진행합니다.</div>
					<div>&nbsp;</div>
					<table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;" cellpadding="3">
						<tr>
							<td style="font-weight: bold; text-align : center;">구성설정</td>
							<td style="font-weight: bold; text-align : center;">상태</td>
						</tr>
						<tr>
							<td>유니코드(UTF-8)인코딩</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_EncodingLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>버전 확인 웹서비스</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_WebServiceLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>CodeSubDir</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_CodeSubDirLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>네임스페이스</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_NamespaceLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>컨트롤</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_ControlLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>핸들러</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_HandlerLabel" runat="server" /></td>
						</tr>
						<tr>
							<td>
								httpRuntime<br />
								- executionTimeout : <asp:TextBox ID="WebConfig_ExecutionTimeoutTextBox" runat="server" />sec<br />
								- maxRequestLength : <asp:TextBox ID="WebConfig_MaxRequestLengthTextBox" runat="server" />kb
							</td>
							<td style="text-align: center; font-weight: bold;"><asp:Label ID="WebConfig_HttpRuntimeLabel" runat="server" /></td>
						</tr>
						<tr>
							<td colspan="2"><asp:Button ID="WebConfigButton" runat="server" Text="저장" 
									OnClick="WebConfigButton_Click" /></td>
						</tr>
					</table>
					<div>&nbsp;</div>
					<div>※ Internet Information Service 7.0을 사용할 경우는 아래 트랙백 핸들러를 추가하십시오.</div>
					<div><span style="color: #0000FF">&lt;</span><span style="color: #990033">system.webServer</span><span 
							style="color: #0000FF">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF">&lt;</span><span 
							style="color: #990033">handlers</span><span style="color: #0000FF">&gt;</span><br />
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF">&lt;</span><span style="color: #990033">add</span>
						<span style="color: #FF0000">name</span><span style="color: #0000FF">=&quot;VWebTrackback&quot;</span>
						<span style="color: #FF0000">verb</span><span style="color: #0000FF">=&quot;GET,POST&quot;</span>
						<span style="color: #FF0000">path</span><span style="color: #0000FF">=&quot;VWebTrackback.ashx&quot;</span><br />
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000">type</span><span style="color: #0000FF">=&quot;VioletDevelopmentLaboratory.Net.Web.Component.TrackbackHandler&quot;/&gt;</span><br />
						&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF">&lt;/</span><span style="color: #990033">handlers</span><span 
							style="color: #0000FF">&gt;</span><br /><span style="color: #0000FF">&lt;/</span><span 
							style="color: #990033">system.webServer</span><span style="color: #0000FF">&gt;</span></div>
				</asp:WizardStep>
				<asp:WizardStep runat="server" Title="6. 기본 설정" OnActivate="WizardStep5_Active">
					<div>어플리케이션이름과 DB연결문자열을 선택하여 저장에 성공하면 다음 단계로 진행합니다.</div>
					<div>&nbsp;</div>
					<table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;" cellpadding="3">
						<tr>
							<td>ApplicationName</td>
							<td>
								<asp:TextBox ID="ApplicationNameTextBox" runat="server" />
								<div>*어플리케이션이름을 설정합니다. 이 설정은 최초 설정후 변경하지 마십시오.</div>
							</td>
						</tr>
						<tr>
							<td>ConnectionStringName</td>
							<td>
								<asp:DropDownList ID="ConnectionStringNameDropDownList" runat="server"
									DataSourceID="DBConnectionObjectDataSource" DataTextField="Name" 
									DataValueField="Name" />
							</td>
						</tr>
						<tr>
							<td colspan="2"><asp:Button ID="VWebBasicButton" runat="server" Text="저장" 
									OnClick="VWebBasicButton_Click" /></td>
						</tr>
					</table>
				</asp:WizardStep>
				<asp:WizardStep runat="server" Title="7. 관리자 설정" 
					OnActivate="WizardStep6_Active">
					<div>관리자를 설정합니다. 3단계와 4단계에서 만들었던 관리자 계정 이름이나 관리자 역할 이름으로 설정할 수 있습니다. 저장에 성공하면 다음 단계로 진행합니다.</div>
					<div>&nbsp;</div>
					<table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;" cellpadding="3">
						<tr>
							<td>Role</td>
							<td>
								<asp:TextBox ID="AdministratorRoleNameTextBox" runat="server" ReadOnly="true" />
								<asp:DropDownList ID="RoleDropDownList" runat="server" AutoPostBack="true" 
									onselectedindexchanged="RoleDropDownList_SelectedIndexChanged" />
								(관리자역할은 하나만 설정할 수 있습니다.)
							</td>
						</tr>
						<tr>
							<td>Names</td>
							<td>
								<asp:TextBox ID="AdministratorNamesTextBox" runat="server" />
								(관리자가 여러명일경우 콤마(,)로 구분)
							</td>
						</tr>
						<tr>
							<td>Email</td>
							<td>
								<asp:TextBox ID="AdministratorEmailTextBox" runat="server" Columns="50" />
								<asp:RegularExpressionValidator ID="AdministratorEmailTextBoxRegularExpressionValidator"
									runat="server" ErrorMessage="*" ControlToValidate="AdministratorEmailTextBox" 
									ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
							</td>
						</tr>
						<tr>
							<td>PublicationReport</td>
							<td>
								<asp:CheckBox ID="PublicationReportCheckBox" runat="server" />
								<div>*게시 보고. 게시판에 글, 댓글이 등록, 변경된 경우 그 내용을 관리자 Email로 보고합니다. 이 기능은 서버에 SMTP서비스가 사용가능하도록 설정되어 있어야 합니다.</div>
							</td>
						</tr>
						<tr>
							<td colspan="2"><asp:Button ID="VWebAdminButton" runat="server" Text="저장" 
									OnClick="VWebAdminButton_Click" /></td>
						</tr>
					</table>
				</asp:WizardStep>
				<asp:WizardStep runat="server" Title="8. 완료">
					<h1>설정이 완료되었습니다.<br />VBoard Setup 페이지는 삭제하거나 일반 사용자가 접근할 수 없도록 하시기 바랍니다.</h1>
					<div>&nbsp;</div>
				</asp:WizardStep>
			</WizardSteps>
			<SideBarStyle CssClass="SideBar" />
			<StepStyle CssClass="Step" />
			<FinishNavigationTemplate>
				&nbsp;
			</FinishNavigationTemplate>
		</asp:Wizard>
    
    </div>
    </form>
</body>
</html>
